// mircoApp/new-auction/components/bidding.js
const app = getApp();
Component({

  /**
   * 组件的属性列表
   */
  properties: {
    infoData: {
      type: null
    },
    pageName: {
      type: String,
      value: ''
    },
    detailsTag: {
      type: null,
      value: ''
    }
  },

  /**
   * 组件的初始数据
   */
  data: {

  },
  lifetimes: {
    attached() {
      let language = wx.getStorageSync("langIndex");
      this.setData({
        language: language.en
      })
    }
  },
  /**
   * 组件的方法列表
   */
  methods: {
    pickUp_mentioned() {
      if(this.data.infoData.stock == 0){
        app.tips('库存不足');
        return
      }
      this.triggerEvent('pickUp_new', {
        id: this.data.infoData.activity_id,
        item: this.data.infoData
      })
    },
    pickUp() {
      this.triggerEvent('pickUp', {
        id: this.data.infoData.id,
        item: this.data.infoData
      })
    },
    settle_handle() {
      this.triggerEvent('settle_handle', {
        id: this.data.infoData.id,
        item: this.data.infoData
      })
    },
    cancelAuction() {
      this.triggerEvent("cancelAuction", {
        id: this.data.infoData.id
      })
    }
  }
})